# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time        : 2021/9/17 15:29
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : pil_upsample.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from matplotlib import pyplot as plt
from PIL import Image

# 读取原始PNG图片
png_im = Image.open("./../experiment_fig/interpolation.png")
# 所有支持插值方式列表
interp_algos = {"LANCZOS": 1, "LINEAR": 2, "BICUBIC": 3}
keys = interp_algos.keys()
for interp_algo in keys:
    val = interp_algos[interp_algo]
    plt.subplot(1, 3, val)
    plt.title(interp_algo)
    up_sampled_png = png_im.resize((png_im.width * 5, png_im.height * 5), val)
    plt.imshow(up_sampled_png, cmap="gray")
plt.show()
